#include <QCoreApplication>
#include <iostream>
#include <vector>
#include <set>
#include <string>
using namespace std;
int OK=0;
class CrazyCrazy
{
public:
    string possible(string song)
    {
     string Shiki(song),Frederica;
     compareShikeAndFrederica(Shiki,Frederica,1);
     if(OK) return "possible";
     return "impossible";
    }
    void compareShikeAndFrederica(string a,string b,int pos)
    {       
        if(OK) return;
        cout<<a<<" "<<b<<"\n";
        for(int i=pos;i<a.size();i++)
        {
           b.push_back(a[i]);
           a.erase(i,1);
           if(a.compare(0,b.size(),b)==0)
           {
            if(a.size()==b.size())
            {
                OK=1;
                return;
            }
            compareShikeAndFrederica(a,b,i);
           }
           a.insert(i,1,b.back());
           b.pop_back();
        }
       return ;
    }
};

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    CrazyCrazy test;
    cout<<test.possible("arqmpfvvbtltlhufznkldkurrazmgebfxeamrewn");

    return a.exec();
}
